package cn.wanda.bi.sunshine.platform.server.service;

import java.util.stream.Stream;

/**
 * Created by wangfupeng1 on 2017-3-24.
 */
public interface BaseService<Example, Entity> {

    int count(Example example);

    Stream<Entity> query(Example example);

    Stream<Entity> all();

    <Key> Entity getByPrimaryKey(Key key);

    <Key> void deleteByPrimaryKey(Key key);

    Entity create(Entity entity);

    Entity update(Entity entity);

}
